package com.foxnicweb.app.domain.patent;

import com.github.foxnic.dao.entity.Entity;
import io.swagger.annotations.ApiModel;
import javax.persistence.Table;
import com.github.foxnic.sql.meta.DBTable;
import com.foxnicweb.app.constants.db.PatentTables.PAT_PATENT_PROCESS;
import javax.persistence.Id;
import io.swagger.annotations.ApiModelProperty;
import com.foxnicweb.app.constants.enums.patent.PatentProcessStatus;
import javax.persistence.Transient;
import com.github.foxnic.api.swagger.EnumFor;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.github.foxnic.web.domain.bpm.ProcessInstance;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.foxnic.commons.reflect.EnumUtil;
import com.github.foxnic.commons.lang.StringUtil;
import com.github.foxnic.commons.lang.DataParser;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import com.github.foxnic.dao.entity.EntityContext;
import com.foxnicweb.app.domain.patent.meta.PatentProcessMeta;
import com.github.foxnic.sql.data.ExprRcd;



/**
 * 审批流程实例
 * <p>审批流程实例 , 数据表 pat_patent_process 的PO类型</p>
 * @author 李方捷 , leefangjie@qq.com
 * @since 2023-06-05 14:41:21
 * @sign 73A71C09772FA27B6CCB04F20450FCC0
 * 此文件由工具自动生成，请勿修改。若表结构或配置发生变动，请使用工具重新生成。
*/

@Table(name = "pat_patent_process")
@ApiModel(description = "审批流程实例 ; 审批流程实例 , 数据表 pat_patent_process 的PO类型")
public class PatentProcess extends Entity {

	private static final long serialVersionUID = 1L;

	public static final DBTable TABLE =PAT_PATENT_PROCESS.$TABLE;
	
	/**
	 * 主键：与 pat_patent 表的ID值一致
	*/
	@Id
	@ApiModelProperty(required = true,value="主键" , notes = "与 pat_patent 表的ID值一致" , example = "2451879")
	private Long id;
	
	/**
	 * 流程实例ID：流程实例ID
	*/
	@ApiModelProperty(required = false,value="流程实例ID" , notes = "流程实例ID" , example = "718110005412233216")
	private String processInstanceId;
	
	/**
	 * 审批状态：审批状态
	*/
	@ApiModelProperty(required = false,value="审批状态" , notes = "审批状态" , example = "A01")
	private String status;
	@Transient
	@EnumFor("status")
	private PatentProcessStatus statusEnum;
	
	/**
	 * 创建人ID：创建人ID
	*/
	@ApiModelProperty(required = false,value="创建人ID" , notes = "创建人ID")
	private String createBy;
	
	/**
	 * 创建时间：创建时间
	*/
	@ApiModelProperty(required = false,value="创建时间" , notes = "创建时间" , example = "2023-06-05 02:32:47")
	private Date createTime;
	
	/**
	 * 修改人ID：修改人ID
	*/
	@ApiModelProperty(required = false,value="修改人ID" , notes = "修改人ID" , example = "110588348101165911")
	private String updateBy;
	
	/**
	 * 修改时间：修改时间
	*/
	@ApiModelProperty(required = false,value="修改时间" , notes = "修改时间" , example = "2023-06-05 02:32:51")
	private Date updateTime;
	
	/**
	 * 是否已删除：是否已删除
	*/
	@ApiModelProperty(required = true,value="是否已删除" , notes = "是否已删除" , example = "0")
	private Integer deleted;
	@Transient
	@EnumFor("deleted")
	private Boolean deletedBool;
	
	/**
	 * 删除人ID：删除人ID
	*/
	@ApiModelProperty(required = false,value="删除人ID" , notes = "删除人ID")
	private String deleteBy;
	
	/**
	 * 删除时间：删除时间
	*/
	@ApiModelProperty(required = false,value="删除时间" , notes = "删除时间")
	private Date deleteTime;
	
	/**
	 * 数据版本号：数据版本号
	*/
	@ApiModelProperty(required = true,value="数据版本号" , notes = "数据版本号" , example = "2")
	private Integer version;
	
	/**
	 * 是否交底：是否交底
	*/
	@ApiModelProperty(required = false,value="是否交底" , notes = "是否交底")
	private Integer isGotBase;
	
	/**
	 * 继续：无交底继续
	*/
	@ApiModelProperty(required = false,value="继续" , notes = "无交底继续")
	private Integer noBaseContinue;
	
	/**
	 * 事务所能否完成：事务所能否完成
	*/
	@ApiModelProperty(required = false,value="事务所能否完成" , notes = "事务所能否完成")
	private Integer canOfficeDone;
	
	/**
	 * 材料是否完整：A
	*/
	@ApiModelProperty(required = false,value="材料是否完整" , notes = "A")
	private Integer isMaterialComplete;
	
	/**
	 * 代理能否完成：代理能否完成
	*/
	@ApiModelProperty(required = false,value="代理能否完成" , notes = "代理能否完成")
	private Integer canAgentDone;
	
	/**
	 * 是否定稿：是否定稿
	*/
	@ApiModelProperty(required = false,value="是否定稿" , notes = "是否定稿")
	private Integer finalized;
	
	/**
	 * 案件类型：1发明专利 2实用新型 3外观设计
	*/
	@ApiModelProperty(required = false,value="案件类型" , notes = "1发明专利 2实用新型 3外观设计" , example = "1")
	private String subtype;
	
	/**
	 * 客户名称：客户名称
	*/
	@ApiModelProperty(required = false,value="客户名称" , notes = "客户名称" , example = "长沙理工大学-尹来容-代交专利")
	private String customerName;
	
	/**
	 * 是否检索：是否检索
	*/
	@ApiModelProperty(required = false,value="是否检索" , notes = "是否检索")
	private Integer retrieval;
	
	/**
	 * 附件清单：附件清单
	*/
	@ApiModelProperty(required = false,value="附件清单" , notes = "附件清单")
	private List<PatentFile> fileList;
	
	/**
	 * 成员清单：成员附件清单
	*/
	@ApiModelProperty(required = false,value="成员清单" , notes = "成员附件清单")
	private List<PatentMember> memberList;
	
	/**
	 * 案件代理人清单：案件代理人清单
	*/
	@ApiModelProperty(required = false,value="案件代理人清单" , notes = "案件代理人清单")
	private List<PatentProcessRole> caseAgentList;
	
	/**
	 * 案件代理人ID清单：案件代理人ID清单
	*/
	@ApiModelProperty(required = false,value="案件代理人ID清单" , notes = "案件代理人ID清单")
	private List<String> caseAgentIds;
	
	/**
	 * 外协对接人清单：外协对接人清单
	*/
	@ApiModelProperty(required = false,value="外协对接人清单" , notes = "外协对接人清单")
	private List<PatentProcessRole> outPersonList;
	
	/**
	 * 外协对接人ID清单：外协对接人ID清单
	*/
	@ApiModelProperty(required = false,value="外协对接人ID清单" , notes = "外协对接人ID清单")
	private List<String> outPersonIds;
	
	/**
	 * 商务助理清单：商务助理清单
	*/
	@ApiModelProperty(required = false,value="商务助理清单" , notes = "商务助理清单")
	private List<PatentProcessRole> businessAssistantList;
	
	/**
	 * 商务助理ID清单：商务助理ID清单
	*/
	@ApiModelProperty(required = false,value="商务助理ID清单" , notes = "商务助理ID清单")
	private List<String> businessAssistantIds;
	
	/**
	 * 附件清单：附件按节点分组
	*/
	@ApiModelProperty(required = false,value="附件清单" , notes = "附件按节点分组")
	private Map<String,List<com.foxnicweb.app.domain.patent.PatentFile>> fileMap;
	
	/**
	 * 成员清单：成员按类型分组清单
	*/
	@ApiModelProperty(required = false,value="成员清单" , notes = "成员按类型分组清单")
	private Map<String,List<com.foxnicweb.app.domain.patent.PatentMember>> memberMap;
	
	/**
	 * 专利案：专利案
	*/
	@ApiModelProperty(required = false,value="专利案" , notes = "专利案")
	private Patent patent;
	
	/**
	 * 历史流程清单：历史流程清单
	*/
	@ApiModelProperty(required = false,value="历史流程清单" , notes = "历史流程清单")
	private List<ProcessInstance> historicProcessList;
	
	/**
	 * 在批的流程清单：在批的流程清单
	*/
	@ApiModelProperty(required = false,value="在批的流程清单" , notes = "在批的流程清单")
	private List<ProcessInstance> currentProcessList;
	
	/**
	 * 默认流程：优先取在批的流程
	*/
	@ApiModelProperty(required = false,value="默认流程" , notes = "优先取在批的流程")
	private ProcessInstance defaultProcess;
	
	/**
	 * 获得 主键<br>
	 * 与 pat_patent 表的ID值一致
	 * @return 主键
	*/
	public Long getId() {
		return id;
	}
	
	/**
	 * 设置 主键
	 * @param id 主键
	 * @return 当前对象
	*/
	public PatentProcess setId(Long id) {
		this.id=id;
		return this;
	}
	
	/**
	 * 获得 流程实例ID<br>
	 * 流程实例ID
	 * @return 流程实例ID
	*/
	public String getProcessInstanceId() {
		return processInstanceId;
	}
	
	/**
	 * 设置 流程实例ID
	 * @param processInstanceId 流程实例ID
	 * @return 当前对象
	*/
	public PatentProcess setProcessInstanceId(String processInstanceId) {
		this.processInstanceId=processInstanceId;
		return this;
	}
	
	/**
	 * 获得 审批状态<br>
	 * 审批状态
	 * @return 审批状态
	*/
	public String getStatus() {
		return status;
	}
	
	/**
	 * 获得 审批状态 的投影属性<br>
	 * 等价于 getStatus 方法，获得对应的枚举类型
	 * @return 审批状态
	*/
	@Transient
	public PatentProcessStatus getStatusEnum() {
		if(this.statusEnum==null) {
			this.statusEnum = (PatentProcessStatus) EnumUtil.parseByCode(PatentProcessStatus.values(),status);
		}
		return this.statusEnum ;
	}
	
	/**
	 * 设置 审批状态
	 * @param status 审批状态
	 * @return 当前对象
	*/
	@JsonProperty("status")
	public PatentProcess setStatus(String status) {
		this.status=status;
		this.statusEnum= (PatentProcessStatus) EnumUtil.parseByCode(PatentProcessStatus.values(),status) ;
		if(StringUtil.hasContent(status) && this.statusEnum==null) {
			throw new IllegalArgumentException( status + " is not one of PatentProcessStatus");
		}
		return this;
	}
	
	/**
	 * 设置 审批状态的投影属性，等同于设置 审批状态
	 * @param statusEnum 审批状态
	 * @return 当前对象
	*/
	@Transient
	public PatentProcess setStatusEnum(PatentProcessStatus statusEnum) {
		if(statusEnum==null) {
			this.setStatus(null);
		} else {
			this.setStatus(statusEnum.code());
		}
		this.statusEnum=statusEnum;
		return this;
	}
	
	/**
	 * 获得 创建人ID<br>
	 * 创建人ID
	 * @return 创建人ID
	*/
	public String getCreateBy() {
		return createBy;
	}
	
	/**
	 * 设置 创建人ID
	 * @param createBy 创建人ID
	 * @return 当前对象
	*/
	public PatentProcess setCreateBy(String createBy) {
		this.createBy=createBy;
		return this;
	}
	
	/**
	 * 获得 创建时间<br>
	 * 创建时间
	 * @return 创建时间
	*/
	public Date getCreateTime() {
		return createTime;
	}
	
	/**
	 * 设置 创建时间
	 * @param createTime 创建时间
	 * @return 当前对象
	*/
	public PatentProcess setCreateTime(Date createTime) {
		this.createTime=createTime;
		return this;
	}
	
	/**
	 * 获得 修改人ID<br>
	 * 修改人ID
	 * @return 修改人ID
	*/
	public String getUpdateBy() {
		return updateBy;
	}
	
	/**
	 * 设置 修改人ID
	 * @param updateBy 修改人ID
	 * @return 当前对象
	*/
	public PatentProcess setUpdateBy(String updateBy) {
		this.updateBy=updateBy;
		return this;
	}
	
	/**
	 * 获得 修改时间<br>
	 * 修改时间
	 * @return 修改时间
	*/
	public Date getUpdateTime() {
		return updateTime;
	}
	
	/**
	 * 设置 修改时间
	 * @param updateTime 修改时间
	 * @return 当前对象
	*/
	public PatentProcess setUpdateTime(Date updateTime) {
		this.updateTime=updateTime;
		return this;
	}
	
	/**
	 * 获得 是否已删除<br>
	 * 是否已删除
	 * @return 是否已删除
	*/
	public Integer getDeleted() {
		return deleted;
	}
	
	/**
	 * 获得 是否已删除 的投影属性<br>
	 * 等价于 getDeleted 方法，获得对应的枚举类型
	 * @return 是否已删除
	*/
	@Transient
	public Boolean isDeleted() {
		if(this.deletedBool==null) {
			this.deletedBool=DataParser.parseBoolean(deleted);
		}
		return this.deletedBool ;
	}
	
	/**
	 * 设置 是否已删除
	 * @param deleted 是否已删除
	 * @return 当前对象
	*/
	@JsonProperty("deleted")
	public PatentProcess setDeleted(Integer deleted) {
		this.deleted=deleted;
		this.deletedBool=DataParser.parseBoolean(deleted);
		return this;
	}
	
	/**
	 * 设置 是否已删除的投影属性，等同于设置 是否已删除
	 * @param deletedBool 是否已删除
	 * @return 当前对象
	*/
	@Transient
	public PatentProcess setDeleted(Boolean deletedBool) {
		if(deletedBool==null) {
			this.deleted=null;
		} else {
			this.deleted=deletedBool?1:0;
		}
		this.deletedBool=deletedBool;
		return this;
	}
	
	/**
	 * 获得 删除人ID<br>
	 * 删除人ID
	 * @return 删除人ID
	*/
	public String getDeleteBy() {
		return deleteBy;
	}
	
	/**
	 * 设置 删除人ID
	 * @param deleteBy 删除人ID
	 * @return 当前对象
	*/
	public PatentProcess setDeleteBy(String deleteBy) {
		this.deleteBy=deleteBy;
		return this;
	}
	
	/**
	 * 获得 删除时间<br>
	 * 删除时间
	 * @return 删除时间
	*/
	public Date getDeleteTime() {
		return deleteTime;
	}
	
	/**
	 * 设置 删除时间
	 * @param deleteTime 删除时间
	 * @return 当前对象
	*/
	public PatentProcess setDeleteTime(Date deleteTime) {
		this.deleteTime=deleteTime;
		return this;
	}
	
	/**
	 * 获得 数据版本号<br>
	 * 数据版本号
	 * @return 数据版本号
	*/
	public Integer getVersion() {
		return version;
	}
	
	/**
	 * 设置 数据版本号
	 * @param version 数据版本号
	 * @return 当前对象
	*/
	public PatentProcess setVersion(Integer version) {
		this.version=version;
		return this;
	}
	
	/**
	 * 获得 是否交底<br>
	 * 是否交底
	 * @return 是否交底
	*/
	public Integer getIsGotBase() {
		return isGotBase;
	}
	
	/**
	 * 设置 是否交底
	 * @param isGotBase 是否交底
	 * @return 当前对象
	*/
	public PatentProcess setIsGotBase(Integer isGotBase) {
		this.isGotBase=isGotBase;
		return this;
	}
	
	/**
	 * 获得 继续<br>
	 * 无交底继续
	 * @return 继续
	*/
	public Integer getNoBaseContinue() {
		return noBaseContinue;
	}
	
	/**
	 * 设置 继续
	 * @param noBaseContinue 继续
	 * @return 当前对象
	*/
	public PatentProcess setNoBaseContinue(Integer noBaseContinue) {
		this.noBaseContinue=noBaseContinue;
		return this;
	}
	
	/**
	 * 获得 事务所能否完成<br>
	 * 事务所能否完成
	 * @return 事务所能否完成
	*/
	public Integer getCanOfficeDone() {
		return canOfficeDone;
	}
	
	/**
	 * 设置 事务所能否完成
	 * @param canOfficeDone 事务所能否完成
	 * @return 当前对象
	*/
	public PatentProcess setCanOfficeDone(Integer canOfficeDone) {
		this.canOfficeDone=canOfficeDone;
		return this;
	}
	
	/**
	 * 获得 材料是否完整<br>
	 * A
	 * @return 材料是否完整
	*/
	public Integer getIsMaterialComplete() {
		return isMaterialComplete;
	}
	
	/**
	 * 设置 材料是否完整
	 * @param isMaterialComplete 材料是否完整
	 * @return 当前对象
	*/
	public PatentProcess setIsMaterialComplete(Integer isMaterialComplete) {
		this.isMaterialComplete=isMaterialComplete;
		return this;
	}
	
	/**
	 * 获得 代理能否完成<br>
	 * 代理能否完成
	 * @return 代理能否完成
	*/
	public Integer getCanAgentDone() {
		return canAgentDone;
	}
	
	/**
	 * 设置 代理能否完成
	 * @param canAgentDone 代理能否完成
	 * @return 当前对象
	*/
	public PatentProcess setCanAgentDone(Integer canAgentDone) {
		this.canAgentDone=canAgentDone;
		return this;
	}
	
	/**
	 * 获得 是否定稿<br>
	 * 是否定稿
	 * @return 是否定稿
	*/
	public Integer getFinalized() {
		return finalized;
	}
	
	/**
	 * 设置 是否定稿
	 * @param finalized 是否定稿
	 * @return 当前对象
	*/
	public PatentProcess setFinalized(Integer finalized) {
		this.finalized=finalized;
		return this;
	}
	
	/**
	 * 获得 案件类型<br>
	 * 1发明专利 2实用新型 3外观设计
	 * @return 案件类型
	*/
	public String getSubtype() {
		return subtype;
	}
	
	/**
	 * 设置 案件类型
	 * @param subtype 案件类型
	 * @return 当前对象
	*/
	public PatentProcess setSubtype(String subtype) {
		this.subtype=subtype;
		return this;
	}
	
	/**
	 * 获得 客户名称<br>
	 * 客户名称
	 * @return 客户名称
	*/
	public String getCustomerName() {
		return customerName;
	}
	
	/**
	 * 设置 客户名称
	 * @param customerName 客户名称
	 * @return 当前对象
	*/
	public PatentProcess setCustomerName(String customerName) {
		this.customerName=customerName;
		return this;
	}
	
	/**
	 * 获得 是否检索<br>
	 * 是否检索
	 * @return 是否检索
	*/
	public Integer getRetrieval() {
		return retrieval;
	}
	
	/**
	 * 设置 是否检索
	 * @param retrieval 是否检索
	 * @return 当前对象
	*/
	public PatentProcess setRetrieval(Integer retrieval) {
		this.retrieval=retrieval;
		return this;
	}
	
	/**
	 * 获得 附件清单<br>
	 * 附件清单
	 * @return 附件清单
	*/
	public List<PatentFile> getFileList() {
		return fileList;
	}
	
	/**
	 * 设置 附件清单
	 * @param fileList 附件清单
	 * @return 当前对象
	*/
	public PatentProcess setFileList(List<PatentFile> fileList) {
		this.fileList=fileList;
		return this;
	}
	
	/**
	 * 添加 附件清单
	 * @param file 附件清单
	 * @return 当前对象
	*/
	public PatentProcess addFile(PatentFile... file) {
		if(this.fileList==null) fileList=new ArrayList<>();
		this.fileList.addAll(Arrays.asList(file));
		return this;
	}
	
	/**
	 * 获得 成员清单<br>
	 * 成员附件清单
	 * @return 成员清单
	*/
	public List<PatentMember> getMemberList() {
		return memberList;
	}
	
	/**
	 * 设置 成员清单
	 * @param memberList 成员清单
	 * @return 当前对象
	*/
	public PatentProcess setMemberList(List<PatentMember> memberList) {
		this.memberList=memberList;
		return this;
	}
	
	/**
	 * 添加 成员清单
	 * @param member 成员清单
	 * @return 当前对象
	*/
	public PatentProcess addMember(PatentMember... member) {
		if(this.memberList==null) memberList=new ArrayList<>();
		this.memberList.addAll(Arrays.asList(member));
		return this;
	}
	
	/**
	 * 获得 案件代理人清单<br>
	 * 案件代理人清单
	 * @return 案件代理人清单
	*/
	public List<PatentProcessRole> getCaseAgentList() {
		return caseAgentList;
	}
	
	/**
	 * 设置 案件代理人清单
	 * @param caseAgentList 案件代理人清单
	 * @return 当前对象
	*/
	public PatentProcess setCaseAgentList(List<PatentProcessRole> caseAgentList) {
		this.caseAgentList=caseAgentList;
		return this;
	}
	
	/**
	 * 添加 案件代理人清单
	 * @param caseAgent 案件代理人清单
	 * @return 当前对象
	*/
	public PatentProcess addCaseAgent(PatentProcessRole... caseAgent) {
		if(this.caseAgentList==null) caseAgentList=new ArrayList<>();
		this.caseAgentList.addAll(Arrays.asList(caseAgent));
		return this;
	}
	
	/**
	 * 获得 案件代理人ID清单<br>
	 * 案件代理人ID清单
	 * @return 案件代理人ID清单
	*/
	public List<String> getCaseAgentIds() {
		return caseAgentIds;
	}
	
	/**
	 * 设置 案件代理人ID清单
	 * @param caseAgentIds 案件代理人ID清单
	 * @return 当前对象
	*/
	public PatentProcess setCaseAgentIds(List<String> caseAgentIds) {
		this.caseAgentIds=caseAgentIds;
		return this;
	}
	
	/**
	 * 添加 案件代理人ID清单
	 * @param caseAgentId 案件代理人ID清单
	 * @return 当前对象
	*/
	public PatentProcess addCaseAgentId(String... caseAgentId) {
		if(this.caseAgentIds==null) caseAgentIds=new ArrayList<>();
		this.caseAgentIds.addAll(Arrays.asList(caseAgentId));
		return this;
	}
	
	/**
	 * 获得 外协对接人清单<br>
	 * 外协对接人清单
	 * @return 外协对接人清单
	*/
	public List<PatentProcessRole> getOutPersonList() {
		return outPersonList;
	}
	
	/**
	 * 设置 外协对接人清单
	 * @param outPersonList 外协对接人清单
	 * @return 当前对象
	*/
	public PatentProcess setOutPersonList(List<PatentProcessRole> outPersonList) {
		this.outPersonList=outPersonList;
		return this;
	}
	
	/**
	 * 添加 外协对接人清单
	 * @param outPerson 外协对接人清单
	 * @return 当前对象
	*/
	public PatentProcess addOutPerson(PatentProcessRole... outPerson) {
		if(this.outPersonList==null) outPersonList=new ArrayList<>();
		this.outPersonList.addAll(Arrays.asList(outPerson));
		return this;
	}
	
	/**
	 * 获得 外协对接人ID清单<br>
	 * 外协对接人ID清单
	 * @return 外协对接人ID清单
	*/
	public List<String> getOutPersonIds() {
		return outPersonIds;
	}
	
	/**
	 * 设置 外协对接人ID清单
	 * @param outPersonIds 外协对接人ID清单
	 * @return 当前对象
	*/
	public PatentProcess setOutPersonIds(List<String> outPersonIds) {
		this.outPersonIds=outPersonIds;
		return this;
	}
	
	/**
	 * 添加 外协对接人ID清单
	 * @param outPersonId 外协对接人ID清单
	 * @return 当前对象
	*/
	public PatentProcess addOutPersonId(String... outPersonId) {
		if(this.outPersonIds==null) outPersonIds=new ArrayList<>();
		this.outPersonIds.addAll(Arrays.asList(outPersonId));
		return this;
	}
	
	/**
	 * 获得 商务助理清单<br>
	 * 商务助理清单
	 * @return 商务助理清单
	*/
	public List<PatentProcessRole> getBusinessAssistantList() {
		return businessAssistantList;
	}
	
	/**
	 * 设置 商务助理清单
	 * @param businessAssistantList 商务助理清单
	 * @return 当前对象
	*/
	public PatentProcess setBusinessAssistantList(List<PatentProcessRole> businessAssistantList) {
		this.businessAssistantList=businessAssistantList;
		return this;
	}
	
	/**
	 * 添加 商务助理清单
	 * @param businessAssistant 商务助理清单
	 * @return 当前对象
	*/
	public PatentProcess addBusinessAssistant(PatentProcessRole... businessAssistant) {
		if(this.businessAssistantList==null) businessAssistantList=new ArrayList<>();
		this.businessAssistantList.addAll(Arrays.asList(businessAssistant));
		return this;
	}
	
	/**
	 * 获得 商务助理ID清单<br>
	 * 商务助理ID清单
	 * @return 商务助理ID清单
	*/
	public List<String> getBusinessAssistantIds() {
		return businessAssistantIds;
	}
	
	/**
	 * 设置 商务助理ID清单
	 * @param businessAssistantIds 商务助理ID清单
	 * @return 当前对象
	*/
	public PatentProcess setBusinessAssistantIds(List<String> businessAssistantIds) {
		this.businessAssistantIds=businessAssistantIds;
		return this;
	}
	
	/**
	 * 添加 商务助理ID清单
	 * @param businessAssistantId 商务助理ID清单
	 * @return 当前对象
	*/
	public PatentProcess addBusinessAssistantId(String... businessAssistantId) {
		if(this.businessAssistantIds==null) businessAssistantIds=new ArrayList<>();
		this.businessAssistantIds.addAll(Arrays.asList(businessAssistantId));
		return this;
	}
	
	/**
	 * 获得 附件清单<br>
	 * 附件按节点分组
	 * @return 附件清单
	*/
	public Map<String,List<com.foxnicweb.app.domain.patent.PatentFile>> getFileMap() {
		return fileMap;
	}
	
	/**
	 * 设置 附件清单
	 * @param fileMap 附件清单
	 * @return 当前对象
	*/
	public PatentProcess setFileMap(Map<String,List<com.foxnicweb.app.domain.patent.PatentFile>> fileMap) {
		this.fileMap=fileMap;
		return this;
	}
	
	/**
	 * 添加 附件清单
	 * @param key 键
	 * @param file 附件清单
	 * @return 当前对象
	*/
	public PatentProcess putFile(String key,List<com.foxnicweb.app.domain.patent.PatentFile> file) {
		if(this.fileMap==null) this.fileMap=new HashMap<>();
		this.fileMap.put(key ,file);
		return this;
	}
	
	/**
	 * 获得 成员清单<br>
	 * 成员按类型分组清单
	 * @return 成员清单
	*/
	public Map<String,List<com.foxnicweb.app.domain.patent.PatentMember>> getMemberMap() {
		return memberMap;
	}
	
	/**
	 * 设置 成员清单
	 * @param memberMap 成员清单
	 * @return 当前对象
	*/
	public PatentProcess setMemberMap(Map<String,List<com.foxnicweb.app.domain.patent.PatentMember>> memberMap) {
		this.memberMap=memberMap;
		return this;
	}
	
	/**
	 * 添加 成员清单
	 * @param key 键
	 * @param member 成员清单
	 * @return 当前对象
	*/
	public PatentProcess putMember(String key,List<com.foxnicweb.app.domain.patent.PatentMember> member) {
		if(this.memberMap==null) this.memberMap=new HashMap<>();
		this.memberMap.put(key ,member);
		return this;
	}
	
	/**
	 * 获得 专利案<br>
	 * 专利案
	 * @return 专利案
	*/
	public Patent getPatent() {
		return patent;
	}
	
	/**
	 * 设置 专利案
	 * @param patent 专利案
	 * @return 当前对象
	*/
	public PatentProcess setPatent(Patent patent) {
		this.patent=patent;
		return this;
	}
	
	/**
	 * 获得 历史流程清单<br>
	 * 历史流程清单
	 * @return 历史流程清单
	*/
	public List<ProcessInstance> getHistoricProcessList() {
		return historicProcessList;
	}
	
	/**
	 * 设置 历史流程清单
	 * @param historicProcessList 历史流程清单
	 * @return 当前对象
	*/
	public PatentProcess setHistoricProcessList(List<ProcessInstance> historicProcessList) {
		this.historicProcessList=historicProcessList;
		return this;
	}
	
	/**
	 * 添加 历史流程清单
	 * @param historicProcess 历史流程清单
	 * @return 当前对象
	*/
	public PatentProcess addHistoricProcess(ProcessInstance... historicProcess) {
		if(this.historicProcessList==null) historicProcessList=new ArrayList<>();
		this.historicProcessList.addAll(Arrays.asList(historicProcess));
		return this;
	}
	
	/**
	 * 获得 在批的流程清单<br>
	 * 在批的流程清单
	 * @return 在批的流程清单
	*/
	public List<ProcessInstance> getCurrentProcessList() {
		return currentProcessList;
	}
	
	/**
	 * 设置 在批的流程清单
	 * @param currentProcessList 在批的流程清单
	 * @return 当前对象
	*/
	public PatentProcess setCurrentProcessList(List<ProcessInstance> currentProcessList) {
		this.currentProcessList=currentProcessList;
		return this;
	}
	
	/**
	 * 添加 在批的流程清单
	 * @param currentProcess 在批的流程清单
	 * @return 当前对象
	*/
	public PatentProcess addCurrentProcess(ProcessInstance... currentProcess) {
		if(this.currentProcessList==null) currentProcessList=new ArrayList<>();
		this.currentProcessList.addAll(Arrays.asList(currentProcess));
		return this;
	}
	
	/**
	 * 获得 默认流程<br>
	 * 优先取在批的流程
	 * @return 默认流程
	*/
	public ProcessInstance getDefaultProcess() {
		return defaultProcess;
	}
	
	/**
	 * 设置 默认流程
	 * @param defaultProcess 默认流程
	 * @return 当前对象
	*/
	public PatentProcess setDefaultProcess(ProcessInstance defaultProcess) {
		this.defaultProcess=defaultProcess;
		return this;
	}

	/**
	 * 将自己转换成指定类型的PO
	 * @param poType  PO类型
	 * @return PatentProcess , 转换好的 PatentProcess 对象
	*/
	@Transient
	public <T extends Entity> T toPO(Class<T> poType) {
		return EntityContext.create(poType, this);
	}

	/**
	 * 将自己转换成任意指定类型
	 * @param pojoType  Pojo类型
	 * @return PatentProcess , 转换好的 PoJo 对象
	*/
	@Transient
	public <T> T toPojo(Class<T> pojoType) {
		if(Entity.class.isAssignableFrom(pojoType)) {
			return (T)this.toPO((Class<Entity>)pojoType);
		}
		try {
			T pojo=pojoType.newInstance();
			EntityContext.copyProperties(pojo, this);
			return pojo;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public PatentProcess clone() {
		return duplicate(true);
	}

	/**
	 * 复制当前对象
	 * @param all 是否复制全部属性，当 false 时，仅复制来自数据表的属性
	*/
	@Transient
	public PatentProcess duplicate(boolean all) {
		com.foxnicweb.app.domain.patent.meta.PatentProcessMeta.$$proxy$$ inst = new com.foxnicweb.app.domain.patent.meta.PatentProcessMeta.$$proxy$$();
		inst.setNoBaseContinue(this.getNoBaseContinue());
		inst.setProcessInstanceId(this.getProcessInstanceId());
		inst.setCanAgentDone(this.getCanAgentDone());
		inst.setUpdateTime(this.getUpdateTime());
		inst.setIsGotBase(this.getIsGotBase());
		inst.setVersion(this.getVersion());
		inst.setCustomerName(this.getCustomerName());
		inst.setFinalized(this.getFinalized());
		inst.setCreateBy(this.getCreateBy());
		inst.setDeleted(this.getDeleted());
		inst.setCreateTime(this.getCreateTime());
		inst.setUpdateBy(this.getUpdateBy());
		inst.setDeleteTime(this.getDeleteTime());
		inst.setSubtype(this.getSubtype());
		inst.setRetrieval(this.getRetrieval());
		inst.setDeleteBy(this.getDeleteBy());
		inst.setIsMaterialComplete(this.getIsMaterialComplete());
		inst.setId(this.getId());
		inst.setCanOfficeDone(this.getCanOfficeDone());
		inst.setStatus(this.getStatus());
		if(all) {
			inst.setCaseAgentIds(this.getCaseAgentIds());
			inst.setOutPersonList(this.getOutPersonList());
			inst.setMemberMap(this.getMemberMap());
			inst.setPatent(this.getPatent());
			inst.setCaseAgentList(this.getCaseAgentList());
			inst.setFileMap(this.getFileMap());
			inst.setHistoricProcessList(this.getHistoricProcessList());
			inst.setCurrentProcessList(this.getCurrentProcessList());
			inst.setDefaultProcess(this.getDefaultProcess());
			inst.setBusinessAssistantList(this.getBusinessAssistantList());
			inst.setMemberList(this.getMemberList());
			inst.setOutPersonIds(this.getOutPersonIds());
			inst.setBusinessAssistantIds(this.getBusinessAssistantIds());
			inst.setFileList(this.getFileList());
		}
		inst.clearModifies();
		return inst;
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public PatentProcess clone(boolean deep) {
		return EntityContext.clone(PatentProcess.class,this,deep);
	}

	/**
	 * 将 Map 转换成 PatentProcess
	 * @param patentProcessMap 包含实体信息的 Map 对象
	 * @return PatentProcess , 转换好的的 PatentProcess 对象
	*/
	@Transient
	public static PatentProcess createFrom(Map<String,Object> patentProcessMap) {
		if(patentProcessMap==null) return null;
		PatentProcess po = create();
		EntityContext.copyProperties(po,patentProcessMap);
		po.clearModifies();
		return po;
	}

	/**
	 * 将 Pojo 转换成 PatentProcess
	 * @param pojo 包含实体信息的 Pojo 对象
	 * @return PatentProcess , 转换好的的 PatentProcess 对象
	*/
	@Transient
	public static PatentProcess createFrom(Object pojo) {
		if(pojo==null) return null;
		PatentProcess po = create();
		EntityContext.copyProperties(po,pojo);
		po.clearModifies();
		return po;
	}

	/**
	 * 创建一个 PatentProcess，等同于 new
	 * @return PatentProcess 对象
	*/
	@Transient
	public static PatentProcess create() {
		return new com.foxnicweb.app.domain.patent.meta.PatentProcessMeta.$$proxy$$();
	}

	/**
	 * 从 Map 读取
	 * @param map 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(Map<String, Object> map,boolean cast) {
		if(map==null) return false;
		if(cast) {
			this.setNoBaseContinue(DataParser.parse(Integer.class, map.get(PatentProcessMeta.NO_BASE_CONTINUE)));
			this.setProcessInstanceId(DataParser.parse(String.class, map.get(PatentProcessMeta.PROCESS_INSTANCE_ID)));
			this.setCanAgentDone(DataParser.parse(Integer.class, map.get(PatentProcessMeta.CAN_AGENT_DONE)));
			this.setUpdateTime(DataParser.parse(Date.class, map.get(PatentProcessMeta.UPDATE_TIME)));
			this.setIsGotBase(DataParser.parse(Integer.class, map.get(PatentProcessMeta.IS_GOT_BASE)));
			this.setVersion(DataParser.parse(Integer.class, map.get(PatentProcessMeta.VERSION)));
			this.setCustomerName(DataParser.parse(String.class, map.get(PatentProcessMeta.CUSTOMER_NAME)));
			this.setFinalized(DataParser.parse(Integer.class, map.get(PatentProcessMeta.FINALIZED)));
			this.setCreateBy(DataParser.parse(String.class, map.get(PatentProcessMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, map.get(PatentProcessMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, map.get(PatentProcessMeta.CREATE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, map.get(PatentProcessMeta.UPDATE_BY)));
			this.setDeleteTime(DataParser.parse(Date.class, map.get(PatentProcessMeta.DELETE_TIME)));
			this.setSubtype(DataParser.parse(String.class, map.get(PatentProcessMeta.SUBTYPE)));
			this.setRetrieval(DataParser.parse(Integer.class, map.get(PatentProcessMeta.RETRIEVAL)));
			this.setDeleteBy(DataParser.parse(String.class, map.get(PatentProcessMeta.DELETE_BY)));
			this.setIsMaterialComplete(DataParser.parse(Integer.class, map.get(PatentProcessMeta.IS_MATERIAL_COMPLETE)));
			this.setId(DataParser.parse(Long.class, map.get(PatentProcessMeta.ID)));
			this.setCanOfficeDone(DataParser.parse(Integer.class, map.get(PatentProcessMeta.CAN_OFFICE_DONE)));
			this.setStatus(DataParser.parse(String.class, map.get(PatentProcessMeta.STATUS)));
			// others
			this.setPatent(DataParser.parse(Patent.class, map.get(PatentProcessMeta.PATENT)));
			this.setDefaultProcess(DataParser.parse(ProcessInstance.class, map.get(PatentProcessMeta.DEFAULT_PROCESS)));
			return true;
		} else {
			try {
				this.setNoBaseContinue( (Integer)map.get(PatentProcessMeta.NO_BASE_CONTINUE));
				this.setProcessInstanceId( (String)map.get(PatentProcessMeta.PROCESS_INSTANCE_ID));
				this.setCanAgentDone( (Integer)map.get(PatentProcessMeta.CAN_AGENT_DONE));
				this.setUpdateTime( (Date)map.get(PatentProcessMeta.UPDATE_TIME));
				this.setIsGotBase( (Integer)map.get(PatentProcessMeta.IS_GOT_BASE));
				this.setVersion( (Integer)map.get(PatentProcessMeta.VERSION));
				this.setCustomerName( (String)map.get(PatentProcessMeta.CUSTOMER_NAME));
				this.setFinalized( (Integer)map.get(PatentProcessMeta.FINALIZED));
				this.setCreateBy( (String)map.get(PatentProcessMeta.CREATE_BY));
				this.setDeleted( (Integer)map.get(PatentProcessMeta.DELETED));
				this.setCreateTime( (Date)map.get(PatentProcessMeta.CREATE_TIME));
				this.setUpdateBy( (String)map.get(PatentProcessMeta.UPDATE_BY));
				this.setDeleteTime( (Date)map.get(PatentProcessMeta.DELETE_TIME));
				this.setSubtype( (String)map.get(PatentProcessMeta.SUBTYPE));
				this.setRetrieval( (Integer)map.get(PatentProcessMeta.RETRIEVAL));
				this.setDeleteBy( (String)map.get(PatentProcessMeta.DELETE_BY));
				this.setIsMaterialComplete( (Integer)map.get(PatentProcessMeta.IS_MATERIAL_COMPLETE));
				this.setId( (Long)map.get(PatentProcessMeta.ID));
				this.setCanOfficeDone( (Integer)map.get(PatentProcessMeta.CAN_OFFICE_DONE));
				this.setStatus( (String)map.get(PatentProcessMeta.STATUS));
				// others
				this.setPatent( (Patent)map.get(PatentProcessMeta.PATENT));
				this.setDefaultProcess( (ProcessInstance)map.get(PatentProcessMeta.DEFAULT_PROCESS));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}

	/**
	 * 从 Map 读取
	 * @param r 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(ExprRcd r,boolean cast) {
		if(r==null) return false;
		if(cast) {
			this.setNoBaseContinue(DataParser.parse(Integer.class, r.getValue(PatentProcessMeta.NO_BASE_CONTINUE)));
			this.setProcessInstanceId(DataParser.parse(String.class, r.getValue(PatentProcessMeta.PROCESS_INSTANCE_ID)));
			this.setCanAgentDone(DataParser.parse(Integer.class, r.getValue(PatentProcessMeta.CAN_AGENT_DONE)));
			this.setUpdateTime(DataParser.parse(Date.class, r.getValue(PatentProcessMeta.UPDATE_TIME)));
			this.setIsGotBase(DataParser.parse(Integer.class, r.getValue(PatentProcessMeta.IS_GOT_BASE)));
			this.setVersion(DataParser.parse(Integer.class, r.getValue(PatentProcessMeta.VERSION)));
			this.setCustomerName(DataParser.parse(String.class, r.getValue(PatentProcessMeta.CUSTOMER_NAME)));
			this.setFinalized(DataParser.parse(Integer.class, r.getValue(PatentProcessMeta.FINALIZED)));
			this.setCreateBy(DataParser.parse(String.class, r.getValue(PatentProcessMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, r.getValue(PatentProcessMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, r.getValue(PatentProcessMeta.CREATE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, r.getValue(PatentProcessMeta.UPDATE_BY)));
			this.setDeleteTime(DataParser.parse(Date.class, r.getValue(PatentProcessMeta.DELETE_TIME)));
			this.setSubtype(DataParser.parse(String.class, r.getValue(PatentProcessMeta.SUBTYPE)));
			this.setRetrieval(DataParser.parse(Integer.class, r.getValue(PatentProcessMeta.RETRIEVAL)));
			this.setDeleteBy(DataParser.parse(String.class, r.getValue(PatentProcessMeta.DELETE_BY)));
			this.setIsMaterialComplete(DataParser.parse(Integer.class, r.getValue(PatentProcessMeta.IS_MATERIAL_COMPLETE)));
			this.setId(DataParser.parse(Long.class, r.getValue(PatentProcessMeta.ID)));
			this.setCanOfficeDone(DataParser.parse(Integer.class, r.getValue(PatentProcessMeta.CAN_OFFICE_DONE)));
			this.setStatus(DataParser.parse(String.class, r.getValue(PatentProcessMeta.STATUS)));
			return true;
		} else {
			try {
				this.setNoBaseContinue( (Integer)r.getValue(PatentProcessMeta.NO_BASE_CONTINUE));
				this.setProcessInstanceId( (String)r.getValue(PatentProcessMeta.PROCESS_INSTANCE_ID));
				this.setCanAgentDone( (Integer)r.getValue(PatentProcessMeta.CAN_AGENT_DONE));
				this.setUpdateTime( (Date)r.getValue(PatentProcessMeta.UPDATE_TIME));
				this.setIsGotBase( (Integer)r.getValue(PatentProcessMeta.IS_GOT_BASE));
				this.setVersion( (Integer)r.getValue(PatentProcessMeta.VERSION));
				this.setCustomerName( (String)r.getValue(PatentProcessMeta.CUSTOMER_NAME));
				this.setFinalized( (Integer)r.getValue(PatentProcessMeta.FINALIZED));
				this.setCreateBy( (String)r.getValue(PatentProcessMeta.CREATE_BY));
				this.setDeleted( (Integer)r.getValue(PatentProcessMeta.DELETED));
				this.setCreateTime( (Date)r.getValue(PatentProcessMeta.CREATE_TIME));
				this.setUpdateBy( (String)r.getValue(PatentProcessMeta.UPDATE_BY));
				this.setDeleteTime( (Date)r.getValue(PatentProcessMeta.DELETE_TIME));
				this.setSubtype( (String)r.getValue(PatentProcessMeta.SUBTYPE));
				this.setRetrieval( (Integer)r.getValue(PatentProcessMeta.RETRIEVAL));
				this.setDeleteBy( (String)r.getValue(PatentProcessMeta.DELETE_BY));
				this.setIsMaterialComplete( (Integer)r.getValue(PatentProcessMeta.IS_MATERIAL_COMPLETE));
				this.setId( (Long)r.getValue(PatentProcessMeta.ID));
				this.setCanOfficeDone( (Integer)r.getValue(PatentProcessMeta.CAN_OFFICE_DONE));
				this.setStatus( (String)r.getValue(PatentProcessMeta.STATUS));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}
}